﻿Imports System.Windows.Threading

Public Class StartWindow

    Private Timer As DispatcherTimer

    Sub New()

        ' Cet appel est requis par le concepteur.
        InitializeComponent()

        ' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
        'Timer = New DispatcherTimer(DispatcherPriority.Background, Dispatcher)

        'AddHandler Timer.Tick, AddressOf TimerTick
        'Timer.Interval = TimeSpan.FromSeconds(3)
        'Timer.Start()

        Dim op = Dispatcher.BeginInvoke(New Action(AddressOf AsyncInitialization), DispatcherPriority.SystemIdle, Nothing)

        AddHandler op.Completed, AddressOf opcompleted
    End Sub


    Private Sub TimerTick(ByVal sender As Object, ByVal e As EventArgs)
        'If StartModule.AsyncInitializationCompleted Then
        '    Timer.Stop()
        '    RemoveHandler Timer.Tick, AddressOf TimerTick

        '    StartModule.StartWindowClosed = True
        '    Close()

        'End If
    End Sub
    Private Sub AsyncInitialization()
        Dim a = App.Instance
    End Sub

    Private Sub opcompleted(ByVal sender As Object, ByVal e As EventArgs)
        Close()
    End Sub

End Class
